package com.youlu.campus.admin.auth.service;

import com.youlu.campus.admin.auth.entity.Menu;
import com.youlu.campus.admin.auth.entity.SystemResource;
import com.youlu.campus.admin.auth.vo.MenuVo;
import com.youlu.campus.entity.VO.req.SystemResourceQueryVO;
import org.springframework.data.domain.Page;

import java.util.List;

public interface ResourceService {
    List<SystemResource> listByRoleIds(String tenantId, List<String> roleIds);

    List<Menu> listMenus(String userId, String tenantId);

    List<Menu> listMenusByRoleId(String roleId, String tenantId);

    List<Menu> getAllMenus(String tenantId);

    List<SystemResource> listByComIdAndUserId(String userId, String tenantId);

    boolean createMenu(MenuVo menuVo);

    boolean createResource(SystemResource systemResource);

    boolean hasPermisson(String userId, String uri);

    /**
     * 是否有按钮权限
     *
     * @param userId
     * @param permission
     * @return
     */
    boolean hasButtonPermission(String userId, String permission);


    List<SystemResource> listByType(String tenantId, Integer type);

    /**
     * 修改资源
     *
     * @param systemResource
     * @return
     */
    boolean updateResource(SystemResource systemResource);

    SystemResource findOne(String id);

    boolean delete(String id);

    Page<SystemResource> list(SystemResourceQueryVO req);
}
